pi
Get the pi value
The pi()
function returns the value of pi.
<?php echo pi ( ) ; ?>
Try it yourself
pi ( )
Returns an approximation of pi. The float accuracy of the return value is determined by the precision directive in php.ini. The default value is 14. You can also use the M_PI constant that produces the exact same result as pi()
.